﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Filters;
using log4net;

namespace RestNews.Util.CustomFilters
{
    /// <summary>
    /// Filter for caching unhandled exceptions
    /// </summary>
    public class UnhandledExceptionFilter : ExceptionFilterAttribute
    {
        private static ILog log = LogManager.GetLogger(typeof(UnhandledExceptionFilter));

        public override void OnException(HttpActionExecutedContext context)
        {
            log.Error(context.Exception);
        }
    }
}